import unittest, os, datetime
from libs.utils.HTMLTestReportCN import HTMLTestRunner
from testcase.shenghuo import ShenghuoCase

if __name__ == "__main__":
    # 此用法可以同时测试多个类
    suite1 = unittest.TestLoader().loadTestsFromTestCase(ShenghuoCase)
    # suite = unittest.TestSuite([suite1, suit2])

    timestamp = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')
    report_name = 'result/%sReport.html' % timestamp  # 用时间戳命名报告

    filePath = os.path.join(os.path.abspath('..'), report_name)
    with open(filePath, 'wb') as fp:
        runner = HTMLTestRunner(stream=fp, verbosity=2, title='自动化测试报告', description='', tester="QA")
        runner.run(suite1)